package model

import (
	"fmt"
)

// Customer
// @Description: 顾客结构体
type Customer struct {
	Id     int
	Name   string
	Gender string
	Age    int
	Phone  string
	Email  string
}

// GenerateCustomerWithoutId NewCustomer2 获取一个Customer, 不提供id
func GenerateCustomerWithoutId(name string, gender string, age int, phone string, email string) *Customer {
	return &Customer{
		Name:   name,
		Gender: gender,
		Age:    age,
		Phone:  phone,
		Email:  email,
	}
}

// UpdateCustomer 修改客户信息
func (c *Customer) UpdateCustomer(id int, name string, gender string, age int, phone string, email string) {
	c.Id = id
	c.Name = name
	c.Gender = gender
	c.Age = age
	c.Phone = phone
	c.Email = email
}

// GetInfo 返回Customer的信息
func (c *Customer) GetInfo() string {
	var info string
	info = fmt.Sprintf("%v\t%v\t%v\t%v\t%v\t%v",
		c.Id, c.Name, c.Gender, c.Age, c.Phone, c.Email)
	return info
}
